#ifndef __ASSERT_H__
#define __ASSERT_H__

extern void _panic(const char *s, ...);

#define panic(msg) _panic("[panic]: %s\n", msg);

#define assert(expression) \
    do { \
        if (!(expression)) { \
            _panic("Assertion failed: %s, file %s, line %d\n", \
                   #expression, __FILE__, __LINE__); \
            while(1); \
        } \
    } while (0)

#endif